﻿#pragma once
#include "opencv.hpp"
#using <system.drawing.dll>
using namespace System;
using namespace System::Data;
using namespace System::IO;
using namespace System::Drawing;
using namespace System::Drawing::Imaging;

using namespace std;
namespace GOCW {
	public ref class GOCWClass
	{
	public:
		/////例子函数//////
		//1.传递图像
	  /*  MemoryStream ms = new MemoryStream();
		b.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
		byte[] bytes = ms.GetBuffer();
		Bitmap bitmap = client.testMethod(bytes);*/
		Bitmap^  GOCWClass::testMethod(cli::array<unsigned char>^ pCBuf1);

		//2.引用传递int
		/*unsafe
		{
		int* value = stackalloc int[1];
		value[0] = 0;
		int iret = client.allTest(2, 3, value);
		}*/
		int GOCWClass::allTest(int a, int b, int* c);
		
		//3.引用传递字符串
		System::String^ GOCWClass::allTestStr(System::String^ inputStr);

		/////业务函数//////
	    /*unsafe
	    {
	        int* value = stackalloc int[1];//返回代码
	        value[0] = 0;
	        bitmap = client.fetchresult(bytes, value);//调用来自GOClrClasslibrary图像处理算法
	        if (value[0] == 0)//0真1假
	        {
	            res = true;
	        }
	        else
	        {
	            res = false;
	        }
	    }*/
		Bitmap^  GOCWClass::fetchresult(cli::array<unsigned char>^ pCBuf1, int* errorCode);
	
	};
}
